//
//  BaseDetialHeadView.swift
//  OverseasOnlineShopping
//
//  Created by 唐先才 on 16/3/10.
//  Copyright © 2016年 唐先才. All rights reserved.
//

import UIKit

class BaseDetialHeadView: UITableViewHeaderFooterView {

    var headImage: UIImageView?
    var pic_url = String()
    
    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier)
        createUI()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
    func createUI() {
        let view = UIView(frame: frame)
        addSubview(view)
        view.backgroundColor = UIColor.whiteColor()
        headImage = UIImageView()
        guard let headImage = headImage else {
            return
        }
        print("headFrame ==== \(frame)")
        headImage.frame = view.frame
        headImage.contentMode = UIViewContentMode.ScaleAspectFit
        headImage.sd_setImageWithURL(NSURL(string: pic_url))
        view.addSubview(headImage)
    }
}
